home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / Gfx4PCQ.lha / WindowLib / Include / WindowLib.i
Encoding:
Text File  |  1997-07-19  |  26.6 KB  |  781 lines

  1. {*****************************************************************
  2.  ** Windowlib                                                   **
  3.  **                                                             **
  4.  ** © 1994/97 THOR-Software inc.                                **
  5.  ** Version 2.00 / 19.07.1997                                   **
  6.  **                                                             **
  7.  ** Useful graphics support for PCQ                             **
  8.  *****************************************************************}
  9.  
  10. CONST
  11. { --- IDCMP Classes ------------------------------------------------------ }
  12.     NEWSIZE_f           = $00000002;  { See the Programmer's Guide  }
  13.     REFRESHWINDOW_f     = $00000004;  { See the Programmer's Guide  }
  14.     MOUSEBUTTONS_f      = $00000008;  { See the Programmer's Guide  }
  15.     MOUSEMOVE_f         = $00000010;  { See the Programmer's Guide  }
  16.     GADGETDOWN_f        = $00000020;  { See the Programmer's Guide  }
  17.     GADGETUP_f          = $00000040;  { See the Programmer's Guide  }
  18.     MENUPICK_f          = $00000100;  { See the Programmer's Guide  }
  19.     CLOSEWINDOW_f       = $00000200;  { See the Programmer's Guide  }
  20.     RAWKEY_f            = $00000400;  { See the Programmer's Guide  }
  21.     DISKINSERTED_f      = $00008000;  { See the Programmer's Guide  }
  22.     DISKREMOVED_f       = $00010000;  { See the Programmer's Guide  }
  23.     ACTIVEWINDOW_f      = $00040000;  { See the Programmer's Guide  }
  24.     INACTIVEWINDOW_f    = $00080000;  { See the Programmer's Guide  }
  25.     INTUITICKS_f        = $00400000;  { See the Programmer's Guide  }
  26.  
  27. { --- Qualifier ---------------------------------------------------------- }
  28.  
  29.         QUALIFIER_LSHIFT          = $0001;
  30.         QUALIFIER_RSHIFT          = $0002;
  31.         QUALIFIER_CAPSLOCK        = $0004;
  32.         QUALIFIER_CONTROL         = $0008;
  33.         QUALIFIER_LALT            = $0010;
  34.         QUALIFIER_RALT            = $0020;
  35.         QUALIFIER_LCOMMAND        = $0040;
  36.         QUALIFIER_RCOMMAND        = $0080;
  37.         QUALIFIER_NUMERICPAD      = $0100;
  38.         QUALIFIER_REPEAT          = $0200;
  39.         QUALIFIER_MIDBUTTON       = $1000;
  40.         QUALIFIER_RBUTTON         = $2000;
  41.         QUALIFIER_LEFTBUTTON      = $4000;
  42.  
  43. { --- Menu Command constants --------------------------------------------- }
  44.         MC_MENU         = 1;            { entry is a menu }
  45.         MC_ITEM         = 2;            { entry is a item of a menu }
  46.         MC_SUBITEM      = 3;            { entry is a subitem of a item }
  47.         MC_LASTMENU     = $81;          { dummy entry to mark end of menu }
  48.         MC_LASTITEM     = $82;          { end of item list of a menu }
  49.         MC_LASTSUBITEM  = $83;          { end of subitem list of a item }
  50.                 
  51. { --- Menu Command flags ------------------------------------------------- }
  52.         MC_MENUENABLED  = 1;            {menu is active (menus only) }
  53.         MC_NORMALMENU   = 1;            {same}
  54.                                         {item and subitem only flags }
  55.         MC_ITEMENABLED  = $10;          {item is active}
  56.         MC_HIGHCOMP     = $40;          {item is beeing inverted }
  57.         MC_CHECKIT      = $01;          {item is checkable}
  58.         MC_TOGGLE       = $08;          {item is toggleable}
  59.                                         {combined flags}
  60.         MC_BAR          = $C0;          {item is a separator bar }
  61.         MC_READONLY     = $D0;          {item is not selectable }
  62.         MC_NORMAL       = $50;          {normal item type}
  63.         MC_OFF          = $40;          {selectable, but disabled}
  64.         MC_CHECKABLE    = $59;          {a checkmark item}
  65.         MC_OFFCHECK     = $49;          {a disabled checkmark}
  66.                 
  67. { Each menu command entry consists of four entries:
  68.         i)      the menu command constant defining the type of the entry
  69.         ii)     the menu command flags
  70.         iii)    a shortcut character, if any (items & subitems only)
  71.         iv)     the name of the entry as NUL-terminated string OR 
  72.                 an empty string if flags are MC_BAR
  73.                 
  74.         A sample menu command list:
  75.         
  76.         MC_MENU,MC_NORMALMENU,0,"Menu 1"
  77.          MC_ITEM,MC_NORMALITEM,'O',"Open..."
  78.          MC_ITEM,MC_BAR,0,0
  79.          MC_ITEM,MC_OFF,'S',"Save..."
  80.          MC_LASTITEM,0,0,""
  81.         MC_MENU,MC_NORMALMENU,0,"Flags"
  82.          MC_ITEM,MC_NORMALITEM,0,"Style"
  83.           MC_SUBITEM,MC_CHECKABLE,'P',"Plain"
  84.           MC_SUBITEM,MC_CHECKABLE,'I',"Italic"
  85.           MC_SUBITEM,MC_CHECKABLE,'B',"Bold"
  86.           MC_SUBITEM,MC_CHECKABLE,'U',"Underline"
  87.           MC_LASTSUBITEM,0,0,""
  88.          MC_ITEM,MC_OFFCHECK,0,"Save ASCII"
  89.          MC_LASTITEM,0,0,""
  90.         MC_LASTMENU,0,0,""
  91. }
  92.  
  93. { --- Monitor Types ------------------------------------------------------ }
  94.         {OR all types together to get monitor. PAL,NTSC etc. work only
  95.          in 2.0 or higher...}
  96.          
  97.         {Monitor types...}
  98.         MON_NTSC        =       $11000;
  99.         MON_PAL         =       $21000;
  100.         MON_VGA         =       $31004; {OR with HIRES, or you get SUPERLORES}
  101.         MON_A2024       =       $41000;
  102.         MON_A2024_15    =       $49000;
  103.         MON_SUPER72     =       $81000;
  104.         MON_EURO36      =       $71000;
  105.         MON_EURO72      =       $61004; {OR with HIRES, or you get SUPERLOWRES}
  106.         MON_DBLNTSC     =       $91000;
  107.         MON_DBLPAL      =       $A1000;
  108.         
  109.         
  110.         MON_LORES       =       $0000;
  111.         MON_HIRES       =       $8000;
  112.         MON_SUPER       =       $8020;
  113.         MON_HAM         =       $0800;
  114.         MON_LACE        =       $0004;
  115.         MON_VGALACE     =       $0001; {USE for VGA,EURO72}
  116.         MON_EHB         =       $0080;
  117.  
  118. { some useful window flags }
  119.  
  120.         WINFLG_SIZEGADGET   =  $00000001;  { include sizing system-gadget? }
  121.         WINFLG_DRAGBAR      =  $00000002;  { include dragging system-gadget? }
  122.         WINFLG_DEPTHGADGET  =  $00000004;  { include depth arrangement gadget? }
  123.         WINFLG_CLOSEGADGET  =  $00000008;  { include close-box system-gadget? }
  124.  
  125.         WINFLG_SIZEBRIGHT   =  $00000010;  { size gadget uses right border }
  126.         WINFLG_SIZEBBOTTOM  =  $00000020;  { size gadget uses bottom border }
  127.  
  128. { --- refresh modes ------------------------------------------------------ }
  129. { combinations of the WFLG_REFRESHBITS select the refresh type }
  130.  
  131.         WINFLG_SMART_REFRESH = $00000000;
  132.         WINFLG_SIMPLE_REFRESH= $00000040;
  133.  
  134.         WINFLG_BACKDROP      = $00000100;  { this is a backdrop window }
  135.         WINFLG_BORDERLESS    = $00000800;  { to get a Window sans border }
  136.         WINFLG_ACTIVATE      = $00001000;  { when Window opens, it's Active }
  137.  
  138. { defintions for the sprite allocation OpenSprite }
  139.  
  140.         SPRITE_HARDWARE         = $1;   { use real hardware sprite }
  141.         SPRITE_SAVEBACK         = $2;   { save background for bobs }
  142.         SPRITE_OVERLAY          = $4;   { overlay over background }
  143.         SPRITE_MUSTDRAWN        = $8;   { sprite must be drawn }
  144.  
  145. { definitions for the border collisions }
  146.         COLLIDE_BORDER          = $1;   { set this as hitmask to receive boundary hits }
  147.  
  148.         COLLIDE_TOP             = $10000; { get these results } 
  149.         COLLIDE_BOTTOM          = $20000;
  150.         COLLIDE_LEFT            = $40000;
  151.         COLLIDE_RIGHT           = $80000;
  152.           
  153. TYPE
  154.         SpritePtr       =       Address;
  155.         ScreenPtr       =       Address;
  156.         WindowPtr       =       Address;
  157.         GadgetPtr       =       Address;
  158.         IntuiMessagePtr =       Address;        { DO NOT care, DO NOT touch! }
  159.         MenuCommand     =       RECORD
  160.                 MenuType        :       BYTE;
  161.                 MenuFlags       :       BYTE;
  162.                 ShortCut        :       CHAR;
  163.                 reserved        :       BYTE;
  164.                 MenuText        :       String;
  165.         END;
  166.         MenuCommandArray = ARRAY[0..0] OF MenuCommand; {define for own purposes}
  167.  
  168. VAR
  169.         ConsoleBase,
  170.         DiskFontBase,
  171.         LayersBase,
  172.         GfxBase         :       Address;
  173.                 
  174.  
  175. PROCEDURE SortCoords(VAR x1,y1,x2,y2 : SHORT);
  176. EXTERNAL;
  177. { sort two pairs of coordinates to be left,top,right,bottom }
  178.         
  179. PROCEDURE ExitGraphics;
  180. EXTERNAL;
  181. { close graphic subsystem: You MUST call this before exit}
  182.         
  183. PROCEDURE InitGraphics;
  184. EXTERNAL;
  185. { initialize graphic subsytem: You MUST call this before starting}
  186.         
  187. PROCEDURE InstallStdClip(w : WindowPtr);
  188. EXTERNAL;
  189. { installes standard cliprect in non-GZZ-windows. You can use this call
  190.   to restore the cliprect back to default values after Clip,SetOffset. }
  191.  
  192. PROCEDURE DeleteButton(g : GadgetPtr);
  193. EXTERNAL;
  194. { given a gadget, this procedure removes the gadget from the window 
  195.   and deletes it }
  196.  
  197. PROCEDURE OffButton(g : GadgetPtr);
  198. EXTERNAL;
  199. { disable a gadget }
  200.         
  201. PROCEDURE OnButton(g : GadgetPtr);
  202. EXTERNAL;
  203. { enable a gadget }
  204.  
  205. PROCEDURE RefreshButton(g : GadgetPtr);
  206. EXTERNAL;
  207. { redraw a gadget }
  208.         
  209. FUNCTION CreateTextButton(w : WindowPtr;x,y,xsize,ysize : SHORT;text : String) : GadgetPtr;
  210. EXTERNAL;
  211. { create a button with a text in it at given coordinates and given size }
  212.  
  213. FUNCTION CreateTextToggle(w : WindowPtr;x,y,xsize,ysize : SHORT;text : String) : GadgetPtr;
  214. EXTERNAL;
  215. { create a toggle button with a text in it at given coordinates and given size }
  216.         
  217. PROCEDURE SetToggle(g : GadgetPtr;state : BOOLEAN);
  218. EXTERNAL;
  219. { set state of a toggle gadget};
  220.         
  221. FUNCTION GetToggle(g : GadgetPtr) : BOOLEAN;
  222. EXTERNAL;
  223. { get state of a toggle gadget};
  224.         
  225. FUNCTION IDFromGadget(g : GadgetPtr) : SHORT;
  226. EXTERNAL;
  227. { calculates the ID of a given gadget }
  228.         
  229. FUNCTION GadgetFromID(w : WindowPtr;id : SHORT) : GadgetPtr;
  230. EXTERNAL;
  231. { calculates the gadgethandle from the ID, returns NIL if not found }
  232.         
  233. PROCEDURE RequestStart(w : WindowPtr;what : INTEGER);
  234. EXTERNAL;
  235. { starts a request of given type (see constants above) at given window }
  236.  
  237. PROCEDURE RequestEnd(w : WindowPtr;what : INTEGER);
  238. EXTERNAL;
  239. { ends a request }
  240.  
  241. FUNCTION NextRequest(w : WindowPtr) : INTEGER;
  242. EXTERNAL;
  243. { returns the last event happened or 0 if not }
  244.  
  245. FUNCTION WaitRequest(w : WindowPtr) : INTEGER;
  246. EXTERNAL;
  247. { returns the last event happend or waits if not }
  248.  
  249. FUNCTION LastGadgetID(w : WindowPtr) : INTEGER;
  250. EXTERNAL;
  251. { returns the ID of the last gadget selected }
  252.  
  253. FUNCTION MouseButton(w : WindowPtr) : BOOLEAN;
  254. EXTERNAL;
  255. { returns the state of the mouse button, may send task to sleep for
  256.   max. 1/6 sec. }
  257.         
  258. FUNCTION ModIDCMP(w : WindowPtr; new : INTEGER) : INTEGER;
  259. EXTERNAL;
  260. { modifies the IDCMP-flags. You should know what you're doing if you
  261.   call this. Return the previous flags.
  262.   This call should not be used by quiche-eaters...}
  263.   
  264. FUNCTION GetWindowMsg(w : WindowPtr)    : IntuiMessagePtr;
  265. EXTERNAL;
  266. { returns the lastest message arrived at window w. After using it,
  267.   you should reply it with ReplyMsg(msg). 
  268.   Also no use for quiche-eaters...}
  269.   
  270. FUNCTION WaitUntilWindow(w : WindowPtr) : IntuiMessagePtr;
  271. EXTERNAL;
  272. { send task to sleep untit message arrives, returns the message -
  273.   already removed from window - in contrast to WaitMsg.
  274.   Use this only if you're shure what it does...}
  275.   
  276. FUNCTION OpenAWindow(left,top,wdth,hght,flgs: INTEGER; tit : String) : WindowPtr;
  277. EXTERNAL;
  278. { opens a window at given position, given size, flags and title. Returns
  279.   a handle to that window - as needed by all other procedures.
  280.   Flags should be 14 for most resons, see Libraries/Autodocs for more.
  281.   THIS CALL MAY FAIL ! - Check the value: If NIL, there's no window !
  282.   This call is only present for backward compatibility, use
  283.   OpenScreenWindow with Screen set to NIL instead ! }
  284.   
  285. FUNCTION OpenScreenWindow(s : ScreenPtr;left,top,wdth,hght,flgs : INTEGER; tit : String) : WindowPtr;
  286. EXTERNAL;
  287. { works like OpenAWindow, but opens window on given screen. NIL is the
  288.   workbench.
  289.   THIS CALL MAY FAIL ! }
  290.   
  291. PROCEDURE CloseAWindow(w : WindowPtr);
  292. EXTERNAL;
  293. { closes given window. After this call, the windowpointer is no longer
  294.   available.
  295.   Works fine for both OpenAWindow and OpenScreenWindow }
  296.   
  297. FUNCTION OpenAScreen(left,top,wdth,hgth,dpth,flgs : INTEGER; tit : String) : ScreenPtr;
  298. EXTERNAL;
  299. { opens a new screen at left,top with given width and height.
  300.         WARNING 1:left will be ignored prior to 2.0
  301.   The screen depth is given in dpth.
  302.         WARNING 2:not all depth will work, use them in a range of 1..6
  303.                 for MON_LORES or 1..4 with MON_HIRES.
  304.   The screen type is determinated by flgs (see definitions above).
  305.         WARNING 3:not all monitors support all types, some types
  306.                 (EHB,HAM) need a depth of 6 and NO LORES.
  307.   The default title will be tit.
  308.   The return value is a handle to the screen.
  309.         WARNING 4:THIS CALL MAY FAIL ! If it returns NIL, there's NO
  310.         SCREEN !}
  311.         
  312. PROCEDURE CloseAScreen(s : ScreenPtr);
  313. EXTERNAL;
  314. { closes a given screen (removes it from display and memory).
  315.   You should close all windows of this screen (else this
  316.         procedure does it for you...) }
  317.  
  318. PROCEDURE SetColor(s : ScreenPtr;reg,r,g,b : SHORT);
  319. EXTERNAL;
  320. { sets given color register }
  321.         
  322. PROCEDURE GetColor(s : ScreenPtr;reg : SHORT;VAR r,g,b : SHORT);
  323. EXTERNAL;
  324. { read given color register }
  325.                 
  326. PROCEDURE WaitForIDCMP(w : WindowPtr; what : INTEGER);
  327. EXTERNAL;
  328. { wait until given IDCMP-flag arrives. They don't queue up in this
  329.   release, so watch out. Call this only if you know what IDCMP is. }
  330.   
  331. PROCEDURE Mouse(w : WindowPtr;VAR x,y : SHORT);
  332. EXTERNAL;
  333. { returns current mouse position. Because of multitasking, the values
  334.   returned may be incorrect by a small amount. }
  335.   
  336. PROCEDURE WaitLeftClick(w : WindowPtr;VAR x,y : SHORT);
  337. EXTERNAL;
  338. { wait until user presses left button and return the position }
  339.         
  340. PROCEDURE WaitForClick(w : WindowPtr);
  341. EXTERNAL;
  342. { as above, but does not return mouse position }
  343.         
  344. FUNCTION MouseDown(w : WindowPtr; VAR x,y : SHORT) : BOOLEAN;
  345. EXTERNAL;
  346. { returns position of mouse button - TRUE for down - and position
  347.   of the mouse. This call may send your task to sleep for 1/6th
  348.   second. }
  349.   
  350. FUNCTION MouseMove(w : WindowPtr; VAR x,y : SHORT) : BOOLEAN;
  351. EXTERNAL;
  352. { as above, but waits until mouse get moved }
  353.         
  354. PROCEDURE WaitForClose(w : WindowPtr);
  355. EXTERNAL;
  356. { waits until user presses the close gadget. It's your job to close
  357.   the window with CloseAWindow - that's not done by this procedure}
  358.   
  359. PROCEDURE Color(w : WindowPtr; c : BYTE);
  360. EXTERNAL;
  361. { sets foreground drawing color }
  362.         
  363. PROCEDURE BgColor(w : WindowPtr; c : BYTE);
  364. EXTERNAL;
  365. { sets background color for text }
  366.         
  367. PROCEDURE OlColor(w : WindowPtr; c: BYTE);
  368. EXTERNAL;
  369. { sets outline color, only used if boundary(w,TRUE) called }
  370.         
  371. PROCEDURE Boundary(w : WindowPtr; onoff : BOOLEAN);
  372. EXTERNAL;
  373. { if called with onoff=TRUE, all filled shapes are drawn with a
  374.   frame of color OlColor around them }
  375.   
  376. PROCEDURE DrawMode(w : WindowPtr; mode : BYTE);
  377. EXTERNAL;
  378. { selects drawmode }
  379.         
  380. PROCEDURE SetDrawPattern(w : WindowPtr; pat : SHORT);
  381. EXTERNAL;
  382. { selects pattern for lines }
  383.  
  384. PROCEDURE SetFillPattern(w: WindowPtr; pat : Address ; power : BYTE ; depth : Integer);
  385. EXTERNAL;
  386. { select fill style. 2^power is the height of the pattern. 
  387.   depth is the depth. Only one or the depth of the screen is allowed here.
  388.   pat is the bit pattern, no chip mem needed!}
  389.         
  390. PROCEDURE ClearRaster(w : WindowPtr; color : BYTE);
  391. EXTERNAL;
  392. { fill entire window with given color }
  393.         
  394. PROCEDURE ClearWindow(w : WindowPtr);
  395. EXTERNAL;
  396. { fill entire window with background color }
  397.         
  398. PROCEDURE SetBitMask(w : WindowPtr; mask : BYTE);
  399. EXTERNAL;
  400. { sets bitplane mask }
  401.         
  402. PROCEDURE DrawTo(w : WindowPtr; x,y : SHORT);
  403. EXTERNAL;
  404. { draws a line from last plot/position point to this one }
  405.         
  406. PROCEDURE Ellipse(w : WindowPtr; xm,ym,x,y : SHORT);
  407. EXTERNAL;
  408. { draws a ellipse around xm,ym with radii x,y }
  409.         
  410. FUNCTION Locate(w : WindowPtr; x,y : SHORT) : BYTE;
  411. EXTERNAL;
  412. { returns color of point at x,y or -1 if outside of window }
  413.         
  414. PROCEDURE Scroll(w : WindowPtr; x1,y1,x2,y2,dx,dy : SHORT);
  415. EXTERNAL;
  416. { scroll rectangle x1,y1,x2,y2 given amount dx,dy }
  417.         
  418. PROCEDURE DrawText(w : WindowPtr;text : String);
  419. EXTERNAL;
  420. { write text at last position/plot point }
  421.  
  422. FUNCTION GetTextLength(w : WindowPtr;text : String) : SHORT;
  423. EXTERNAL;
  424. { returns length of text in pixels }
  425.  
  426. PROCEDURE Plot(w : WindowPtr; x,y : SHORT);
  427. EXTERNAL;
  428. { draw one point at x,y in foreground color }
  429.         
  430.  
  431. PROCEDURE Position(w : WindowPtr; x,y : SHORT);
  432. EXTERNAL;
  433. { selects next position for drawto,text,...}
  434.         
  435. PROCEDURE Line(w : WindowPtr; x1,y1,x2,y2 : SHORT);
  436. EXTERNAL;
  437. { draw a line from x1,y1 to x2,y2}
  438.         
  439. PROCEDURE Fill(w : WindowPtr; x,y : SHORT);
  440. EXTERNAL;
  441. { starts flood fill at x,y. THIS CALL MAY FAIL }
  442.   
  443. PROCEDURE PBox(w : WindowPtr; x1,y1,x2,y2 : SHORT);
  444. EXTERNAL;
  445. { draw a filled box from x1,y1,x2,y2 - draw frame around it
  446.   if boudary is TRUE }
  447.   
  448. PROCEDURE Box(w : WindowPtr; x1,y1,x2,y2 : SHORT);
  449. EXTERNAL;
  450. { draw a frame from x1,y1 to x2,y2 }
  451.         
  452. PROCEDURE SetOffset(w : WindowPtr; x,y : SHORT);
  453. EXTERNAL;
  454. { sets coordinate offset. Normally, the leftmost, topmost point
  455.   will have the coordinates 0,0 - after this call it's -x,-y.
  456.   You should note that x,y is relative to a already installed
  457.   offset anyway - so SetOffset(w,0,0) does nothing usefull.
  458.   Use SetOffset(w,-x,-y) or InstallStdClip(w) to restore old
  459.   values. }
  460.   
  461. PROCEDURE Clip(w : WindowPtr; x1,y1,x2,y2 : SHORT);
  462. EXTERNAL;
  463. { installes a clipping rectangle in given window - only
  464.   points inside of the rectangle x1,y1,x2,y2 are affected
  465.   by drawing. To remove the ClipRect again, call 
  466.   InstallStdClip(w).
  467.   However, the coordinates of all points are not moved -
  468.   use SetOffset to move point 0,0 to the left edge of
  469.   your clipping rectangle.}
  470.   
  471. PROCEDURE AddAreaEllipse(w : WindowPtr; xm,ym,x,y : SHORT);
  472. EXTERNAL;
  473. { this is a area function. This means: calling this type of function
  474.   stacks all operation back - the objects are drawn later with a
  475.   call to CompleteArea.
  476.   This call adds a filled ellipse at xm,ym, radii x,y to the object
  477.   stack. }
  478.   
  479. PROCEDURE AddAreaDraw(w : WindowPtr; x,y : SHORT);
  480. EXTERNAL;
  481. { this call adds a point to a filled polygon to the object stack.
  482.   The polygon is completed with a AddAreaPoint or a CompleteArea.
  483.   This call does actually not the drawing, call CompleteArea to
  484.   make your object visible after defining all points. }
  485.   
  486. PROCEDURE AddAreaMove(w : WindowPtr; x,y : SHORT);
  487. EXTERNAL;
  488. { complete old filled polygon - if any - and start a new one at
  489.   x,y. This is again an area function, so its operation is
  490.   invisible until a call to CompleteArea. }
  491.   
  492. PROCEDURE CompleteArea(w : WindowPtr);
  493. EXTERNAL;
  494. { complete all objects and draw them, start a new invisible
  495.   object definition. You must call this if you want to see
  496.   your defined area-objects. }
  497.   
  498. PROCEDURE PEllipse(w : WindowPtr; xm,ym,x,y : SHORT);
  499. EXTERNAL;
  500. { draw a filled ellipse at xm,ym with radii x,y.
  501.   Cause this call uses area-functions, you should not use it
  502.   inside of an area definition or all your objects get lost. }
  503.   
  504. PROCEDURE SetAreaSize(w : WindowPtr; size : SHORT);
  505. EXTERNAL;
  506. { sets size of area object stack. Default is 256 points.
  507.   You should call this if you get an area buffer overflow error. }
  508.         
  509. PROCEDURE Dimensions(w : WindowPtr; VAR width,height : SHORT);
  510. EXTERNAL;
  511. { get size of drawable area in pixels }
  512.         
  513. PROCEDURE SelectPoint(w : WindowPtr; VAR x,y : SHORT);
  514. EXTERNAL;
  515. { let user select a point of the window. }
  516.  
  517. PROCEDURE DragBox(w : WindowPtr; xanc,yanc : SHORT; VAR x,y : SHORT);
  518. EXTERNAL;
  519. { let the user select the other edge of a rectangle.
  520.   This call assumes the user is already pressing the mouse button,
  521.   use this call together with SelectPoint to define a rectangle:
  522.   SelectPoint(w,x1,y1);
  523.   DragBox(w,x2,y2); 
  524.   will do this job - after all x1,y1,x2,y2 contain the rectangle }
  525.  
  526. FUNCTION SetWindowFont(w : WindowPtr;name : String;size : SHORT) : BOOLEAN;
  527. EXTERNAL;
  528. { select the default font of the window.
  529.   This call may fail if the desired font is not available }
  530.   
  531. PROCEDURE Print(w : WindowPtr;text : String);
  532. EXTERNAL;
  533. { Print a string to the window. Unlike DrawText, all escape
  534.   sequences are interpreted, but Print is much slower. }
  535.   
  536. PROCEDURE SetStyle(w : WindowPtr;style : SHORT);
  537. EXTERNAL;
  538. { Select the style of the window default font. }
  539.         
  540. FUNCTION CreateStringField(w : WindowPtr;x,y,xsize,ysize : SHORT) : GadgetPtr;
  541. EXTERNAL;
  542. { Create a field ready for string entry }
  543.         
  544. FUNCTION ActivateField(g : GadgetPtr) : BOOLEAN;
  545. EXTERNAL;
  546. { Activates a string field, returns TRUE on success }
  547.         
  548. FUNCTION BufferFromField(g : GadgetPtr) : String;
  549. EXTERNAL;
  550. { given a string field returns buffer contents }
  551.         
  552. PROCEDURE SetSlider(g : GadgetPtr;choices,viewable,first : SHORT);
  553. EXTERNAL;
  554. { set slider position, viewable elements and # of choices }
  555.         
  556. PROCEDURE SetSliderFirst(g : GadgetPtr;first : SHORT);
  557. EXTERNAL;
  558. { set only position of slider }
  559.         
  560. FUNCTION CreateSlider(w : WindowPtr;x,y,xsize,ysize : SHORT;vert : BOOLEAN) : GadgetPtr;
  561. EXTERNAL;
  562. { create a slider gadget at position with given size.
  563.   if vert is true, it's moveable vertically, else horizontally.}
  564.   
  565. FUNCTION FirstFromSlider(w : GadgetPtr) : SHORT;
  566. EXTERNAL;
  567. { returns current position of slider }
  568.  
  569. PROCEDURE CreateMenu(w : WindowPtr;cmd : Address);
  570. EXTERNAL;
  571. { create a menu }
  572.  
  573. PROCEDURE DeleteMenu(w : WindowPtr);
  574. EXTERNAL;
  575. { delete menu }
  576.         
  577. PROCEDURE LastMenu(w : WindowPtr;VAR menu,item,subitem : SHORT);
  578. EXTERNAL;
  579. { get number of last menu selected, returns -1 if not }
  580.         
  581. PROCEDURE OnMenuPoint(w : WindowPtr;menu,item,subitem : SHORT);
  582. EXTERNAL;
  583. { enable given menu point }
  584.         
  585. PROCEDURE OffMenuPoint(w : WindowPtr;menu,item,subitem : SHORT);
  586. EXTERNAL;
  587. { disable given menu point }
  588.         
  589. PROCEDURE CheckMenu(w : WindowPtr;menu,item,subitem : SHORT;check : BOOLEAN);
  590. EXTERNAL;
  591. { set checkmark of a menupoint. Set if check is TRUE, else clear. }
  592.         
  593. FUNCTION CheckMarkOfMenu(w : WindowPtr;menu,item,subitem : SHORT) : BOOLEAN;
  594. EXTERNAL;
  595. { returns the state of the checkmark of a given menu }
  596.  
  597. PROCEDURE LastKey(w : WindowPtr;text : String;VAR qualifier : SHORT);
  598. EXTERNAL;
  599. { copies the last keyboard entry to text.
  600.   Text should be at least 16 characters long. }
  601.  
  602. PROCEDURE ScreenToBack(s : ScreenPtr);
  603. EXTERNAL;
  604. { make given screen the backmost }
  605.         
  606. PROCEDURE ScreenToFront(s : ScreenPtr);
  607. EXTERNAL;
  608. { make screen the topmost }
  609.  
  610. PROCEDURE ShowTitle(s : ScreenPtr;showit : BOOLEAN);
  611. EXTERNAL;
  612. { show or remove title bar }
  613.         
  614. PROCEDURE WBenchToFront;
  615. EXTERNAL;
  616.  
  617. PROCEDURE WBenchToBack;
  618. EXTERNAL;
  619.  
  620. PROCEDURE OpenWorkBench;
  621. EXTERNAL;
  622.  
  623. PROCEDURE CloseWorkBench;
  624. EXTERNAL;
  625.  
  626. PROCEDURE SetCopperSize(s : ScreenPtr; size : Integer);
  627. EXTERNAL;
  628. {selects the size of the copper list in instructions.
  629.  Usually not needed.}
  630.  
  631. PROCEDURE CopperMove(s : ScreenPtr; register : Integer; value : SHORT);
  632. EXTERNAL;
  633. {add set a hw register by a copper list}
  634.  
  635. PROCEDURE CopperWait(s : ScreenPtr; x,y : SHORT);
  636. EXTERNAL;
  637. {wait for a display position in a copper list}
  638.  
  639. PROCEDURE CopperDone(s : ScreenPtr);
  640. EXTERNAL;
  641. {call this if your copper list is done}
  642.  
  643. PROCEDURE CopperQuit(s : ScreenPtr);
  644. EXTERNAL;
  645. {remove copper list explicitly. Usually NOT needed.}
  646.  
  647. PROCEDURE CopperSetColor(s : ScreenPtr;reg,r,g,b : SHORT);
  648. EXTERNAL;
  649. { sets given color register }
  650.  
  651. PROCEDURE UnlinkSprite(add : SpritePtr);
  652. EXTERNAL;
  653. {remove linkage of one sprite as animation component of another sprite }
  654.  
  655. PROCEDURE CloseSprite(sp : SpritePtr);
  656. EXTERNAL;
  657. {remove sprite from display }
  658.  
  659. FUNCTION OpenSprite(w : WindowPtr;shape : ^String; height : Integer; flags : Integer) : SpritePtr;
  660. EXTERNAL;
  661. {create a sprite. The data is encoded in an Array of strings in ASCII-art.
  662.  Each character in each String represents one pixel. Colors are either
  663.  given as numbers from 0 to 9,A to F OR as the following characters:
  664.  space  =       color 0
  665.  .      =       color 1
  666.  +      =       color 2
  667.  *      =       color 3
  668.  -      =       color 4
  669.  /      =       color 5
  670.  |      =       color 6
  671.  ^      =       color 7
  672.  _      =       color 8
  673.  #      =       color 9
  674.  
  675.  height is the height of the Array in lines. The width is taken from the
  676.  widest String in the Array, all other lines are padded WITH zeros
  677.  at the right edge.
  678.  Flags is an ORed value of the SPRITE_ flags above. }
  679.  
  680.  
  681. PROCEDURE SetSpriteColor(sp : SpritePtr;reg,r,g,b : Integer);
  682. EXTERNAL;
  683. { Define colors FOR hardware TYPE sprites. reg is one to three,
  684.   r,g,b the red, green OR blue component as 4 bit integers, i.e.
  685.   range from 0 to 15 }
  686.  
  687. PROCEDURE SetSpriteShape(sp : SpritePtr;shape : ^String);
  688. EXTERNAL;
  689. { redefine the sprite shape, syntax like OpenSprite. Please note that
  690.   the dimension MUST be the same. IF NOT, you have to CloseSprite()
  691.   the old sprite AND create a new WITH OpenSprite! }
  692.  
  693. PROCEDURE SetCollisionMasks(sp : SpritePtr; me, hit : Short);
  694. EXTERNAL;
  695. { sets the memask AND hitmask FOR the sprite. Collision detection is
  696.   however NOT yet support. }
  697.  
  698. PROCEDURE HideSprite(sp : SpritePtr);
  699. EXTERNAL;
  700. { hide the sprite, i.e. prevent it from drawing }
  701.  
  702. PROCEDURE ShowSprite(sp : SpritePtr);
  703. EXTERNAL;
  704. { show a sprite after hiding }
  705.  
  706. PROCEDURE PlaceSprite(sp : SpritePtr; x,y : Integer);
  707. EXTERNAL;
  708. { move a sprite to a specific position }
  709.  
  710. PROCEDURE LinkSprite(base : SpritePtr; add : SpritePtr);
  711. EXTERNAL;
  712. { link a sprite to a base sprite. Both sprites form an animation
  713.   sequence. All subsequent control calls must go to the base
  714.   sprite.
  715.   THIS IS NOT related to any hardware linking supported by
  716.   denise, i.e. 16 color hardware sprites ARE NOT supported.}
  717.  
  718. PROCEDURE SetSpriteTimer(sp : SpritePtr; time : Short);
  719. EXTERNAL;
  720. { define the time how long a sprite is shown as a part of an
  721.   animation sequence. Makes only sense IF more than one
  722.   sprite is linked together. }
  723.  
  724. PROCEDURE InFrontOf(sp1,sp2 : SpritePtr);
  725. EXTERNAL;
  726. { definie sprite 1 to be drawn in front of sprite 2.
  727.   Please avoid circular linking WITH this call as this
  728.   WILL cause crashes! }
  729.  
  730. PROCEDURE Unordered(sp : SpritePtr);
  731. EXTERNAL;
  732. { don't care about the drawing order of the given sprite }
  733.  
  734. PROCEDURE AnimateSprites(w : WindowPtr);
  735. EXTERNAL;
  736. { update the position of the sprites AND animate them }
  737.  
  738. PROCEDURE RedrawSprites(w : WindowPtr);
  739. EXTERNAL;
  740. { update the shapes AND the colors of the sprites on the screen }
  741.  
  742. PROCEDURE ShareColors(base, add : SpritePtr);
  743. EXTERNAL;
  744. { tell windowlib that two sprites share the same color. This will
  745.   improve the sprite scelduring }
  746.  
  747.  
  748. PROCEDURE OwnColors(sp : SpritePtr);
  749. EXTERNAL;
  750. { tell windowlib that a sprite should use its own colors again }
  751.  
  752. FUNCTION Stick(n : Short) : Short;
  753. EXTERNAL;
  754.  
  755. FUNCTION Strig(n : Short) : Boolean;
  756. EXTERNAL;
  757.  
  758. FUNCTION StickUp(n : Short) : Boolean;
  759. EXTERNAL;
  760.  
  761. FUNCTION StickDown(n : Short) : Boolean;
  762. EXTERNAL;
  763.  
  764. FUNCTION StickLeft(n : Short) : Boolean;
  765. EXTERNAL;
  766.  
  767. FUNCTION StickRight(n : Short) : Boolean;
  768. EXTERNAL;
  769.  
  770. PROCEDURE WaitForStick(unit : Short);
  771. EXTERNAL;
  772.  
  773. PROCEDURE FreeJoystick(unit : Short);
  774. EXTERNAL;
  775.  
  776. FUNCTION ReadCollisionMask(sp : SpritePtr; clearit : Boolean) : Integer;
  777. EXTERNAL;
  778.  
  779. PROCEDURE ShiftSprite(sp : SpritePtr; x,y : Integer);
  780. EXTERNAL;
  781.